package sanshui.system.trade.factory.trade;

import lombok.Data;

import java.util.concurrent.Callable;

import static sanshui.system.trade.common.GlobalContain.FAITH_CODE;

@Data
public class FutureTask<T> {

    String code;
    String message;
    T data;

    public FutureTask() {
        code = FAITH_CODE;
        message = "失败";
        data = null;
    }

    public FutureTask(T data) {
        code = FAITH_CODE;
        message = "失败";
        data = data;
    }

    public FutureTask<T> fail(String message){
        this.setCode(FAITH_CODE);
        this.setMessage(message);
        return this;
    }
}
